package SubClasses;

import java.awt.Color;

public class CellData 
{
	private ObjectInBox InBox;
	private TypeOfVar Entity; 
	private TypeOfVar Back;
	
	public CellData(ObjectInBox InBox,TypeOfVar Entity,TypeOfVar Back) 
	{
		this.InBox = InBox;
		this.Entity = Entity;
		this.Back = Back;
	}
	
	public CellData() 
	{
		this.InBox = null;
		this.Entity = TypeOfVar.Empty;
		this.Back = TypeOfVar.FrameNotFill;
	}
	public ObjectInBox getInBox() {
		return InBox;
	}

	public void setInBox(ObjectInBox inBox) {
		InBox = inBox;
	}

	public TypeOfVar getEntity() {
		return Entity;
	}

	public void setEntity(TypeOfVar entity) {
		Entity = entity;
	}

	public TypeOfVar getBack() {
		return Back;
	}

	public void setBack(TypeOfVar back) {
		Back = back;
	}
	
	//@override
	public String toString()
	{
		if(this.InBox == null)
		{
			return " ";
		}
		else 
		{
			return String.valueOf(InBox.getAscii());
		}	
	}
	public Color GetColorForg()
	{
		if(InBox!=null)
			return InBox.getForg();
		return Color.WHITE;
	}
	public Color GetColorBack()
	{
		if(Back == TypeOfVar.FrameFill)
		{
			return Color.GREEN;
		}
		else if(Back == TypeOfVar.FrameNotFill)
		{
			return Color.WHITE;
		}
		else if(Back == TypeOfVar.ChasingLine)
		{
			return Color.BLUE;
		}
		else if(Back == TypeOfVar.NewLine)
		{
			return Color.RED;
		}
		return Color.WHITE;	
	}
	
}
